package com.server.pinggu.service.impl;

import com.server.pinggu.mapper.SenTranslateMapper;
import com.server.pinggu.service.ISenTranslateService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.apache.commons.lang3.StringUtils;
import com.server.pinggu.domain.SenTranslate;

import java.util.List;

/**
 * 【请填写功能名称】Service业务层处理
 *
 * @author ltao
 * @date 2022-10-23
 */
@Service
public class SenTranslateServiceImpl extends ServiceImpl<SenTranslateMapper, SenTranslate> implements ISenTranslateService {

    @Override
    public List<SenTranslate> queryList(SenTranslate senTranslate) {
        LambdaQueryWrapper<SenTranslate> lqw = Wrappers.lambdaQuery();
        if (StringUtils.isNotBlank(senTranslate.getLang())){
            lqw.eq(SenTranslate::getLang ,senTranslate.getLang());
        }
        if (StringUtils.isNotBlank(senTranslate.getCont())){
            lqw.eq(SenTranslate::getCont ,senTranslate.getCont());
        }
        if (senTranslate.getTid() != null){
            lqw.eq(SenTranslate::getTid ,senTranslate.getTid());
        }
        if (senTranslate.getTag() != null){
            lqw.eq(SenTranslate::getTag ,senTranslate.getTag());
        }
        if (StringUtils.isNotBlank(senTranslate.getTpl())){
            lqw.eq(SenTranslate::getTpl ,senTranslate.getTpl());
        }
        if (StringUtils.isNotBlank(senTranslate.getCode())){
            lqw.eq(SenTranslate::getCode ,senTranslate.getCode());
        }
        if (StringUtils.isNotBlank(senTranslate.getMark())){
            lqw.eq(SenTranslate::getMark ,senTranslate.getMark());
        }
        return this.list(lqw);
    }
}